﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Maticsoft.DBUtility;//请先添加引用

namespace BaoJian.e.control
{
    /// <summary>
    /// 促销产品
    /// </summary>
    public partial class Promotion : System.Web.UI.UserControl
    {
        public string ColumnID = null;
        public string ColTitle = "";
        public string Count = "";
        private string sql = "SELECT top {0} A.PID ,A.[Name],B.[Description],'..\\'+RIGHT([ImagePath] ,LEN([ImagePath] )-2) AS ImagePath  FROM [EProduct] AS A ,[EColumn] AS B WHERE A.[PID] = B.[PID] AND [EColumnID]='{1}' ORDER BY B.[SID] desc";
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!Page.IsPostBack)
            {
                LYQ.BLL.SysObj bll = new LYQ.BLL.SysObj();
                ColTitle = bll.GetModel(ColumnID).OName;

                sql = string.Format(sql,Count, ColumnID);
                DataSet ds = DbHelperSQL.Query(sql);

                Repeater1.DataSource = ds.Tables[0];
                Repeater1.DataBind();

            }
               
        }
    }
}